<extend name="base/Base" />
<block name="Style">
<!-- FooTable Plugin CSS -->
		<link rel="stylesheet" type="text/css" href="__ABSOLUTEADMIN__/vendor/plugins/footable/css/footable.core.min.css">
		<!-- Admin Forms CSS -->
		<link rel="stylesheet" type="text/css" href="__ABSOLUTEADMIN__/assets/admin-tools/admin-forms/css/admin-forms.css">

		<js href="__ADDON__/ueditor/js/jquery-1.11.0.min.js" />
		<js href="__ADDON__/ueditor/cms.admin.config.js" />    
		<js href="__ADDON__/ueditor/ueditor.all.min.js" />
		<script>
		$(function(){
			var url="__APP__/Home/Ueditor/Index/Addon/Ueditor.html";
			var ue = UE.getEditor('container',{
				serverUrl :url,
				UEDITOR_HOME_URL:'__ADDON__/ueditor/',
			});
			

			ue.ready(function(){
				ue.execCommand('serverparam', {
					'uid': "<?php echo getUID(); ?>",
				   'username': '<?php echo getUID(); ?>',
				});
			});

		})
		</script>
		<style>
			.col-md-4{
				
			}
		</style>
		<js href="__ADDON__/ajaxupload/js/jquery.js" />
		<js href="__ADDON__/ajaxupload/js/ajaxupload.js" />
		<script type="text/javascript">
		$(function(){
			var button = $('#upload_button'), interval;
			var confirmdiv = $('#uploadphotoconfirm');
			var fileType = "pic",fileNum = "one"; 
			new AjaxUpload(button,{
				action: "__APP__/Home/Upload/Image/Addon/AjaxUpload.html",
				name: 'userfile',
				onSubmit : function(file, ext){
					if(fileType == "pic")
					{
						if (ext && /^(jpg|png|jpeg|gif|JPG)$/.test(ext)){
							this.setData({
								'info': '文件类型为图片'
							});
						} else {
							 confirmdiv.text('文件格式错误，请上传格式为.png .jpg .jpeg 的图片');
							return false;               
						}
					}
								
					confirmdiv.text('文件上传中');
					
					if(fileNum == 'one')
						this.disable();
					
					interval = window.setInterval(function(){
						var text = confirmdiv.text();
						if (text.length < 14){
							confirmdiv.text(text + '.');                    
						} else {
							confirmdiv.text('文件上传中');             
						}
					}, 200);
				},
				onComplete: function(file, response){
					if(response != "success"){
						if(response =='2'){
							confirmdiv.text("文件格式错误，请上传格式为.png .jpg .jpeg 的图片");
						}else{
							
							confirmdiv.text("上传完成");
							
							$("#newbikephotoName").val(response);
							$("#newbikephoto").attr("src",response);	
							$("#imgurl").attr("value",response);						
							
						}
						
					}
										  
					window.clearInterval(interval);
								
					this.enable();
					
					if(response == "success")
					alert('上传成功');              
				}
			});
		});
		</script>

</block>
<block name="Topbar">
								
 <!-- Start: Topbar -->
      <header id="topbar" class="ph10">
        <div class="topbar-left">
         <ul class="nav nav-list nav-list-topbar pull-left">
           
			<li class="active">
              <a href="__APP__/Mall/Page/create_activity.html">新增活动</a>
            </li>
			<!-- <li>
              <a  href="__APP__/Mall/Page/activity.html">活动管理</a>
            </li> -->
			
           
          </ul>
        </div>
       <!--  <div class="topbar-right hidden-xs hidden-sm">
			<form class="form-inline" action="__APP__/XYZR/Database/MySQL/Backup.html" method="post">
			  <div class="form-group">
				<label for="exampleInputName2">开始时间</label>
				<input type="date" class="form-control" placeholder="请输入开始时间" name="begin_time" value='{$time|time|date="Y-m-d",###}'>
			  </div>
			  <div class="form-group">
				<label for="exampleInputEmail2">结束时间</label>
				<input type="date" class="form-control"  placeholder="请输入开始时间"  name="end_time" value='{$time|time|date="Y-m-d",###}' >
			  </div>
			  <button type="submit" class="btn btn-success">搜索记录</button>
			</form>
        </div>  -->
      </header>
	  						
    				
</block>
<block name="Content">

<!-- START ROW -->

	<div class="row">

		<!-- NEW COL START -->
		<article class="col-md-offset-1 col-sm-12 col-md-12 col-lg-10">
			
			<!-- Widget ID (each widget will need unique ID)-->
			<div class="jarviswidget" id="wid-id-7" data-widget-editbutton="false" data-widget-custombutton="false">
				
				<!-- widget div-->
				<div>
					
					<!-- widget edit box -->
					<div class="jarviswidget-editbox">
						<!-- This area used as dropdown edit box -->
						
					</div>
					<!-- end widget edit box -->
					
					<!-- widget content -->
					<div class="widget-body no-padding">
						
						<form id="smart-form-register" action="__APP__/Mall/Page/Edit_Activity.html"  enctype="multipart/form-data" method="post" class="smart-form">
							
							
							
							 <div class="row">
								 <div class="col-md-4">
									 <div class="form-group">
										<label for="exampleInputEmail1">请输入活动标题</label>
										<input type="text"  name="name" id="name" class="form-control"  placeholder="请输入活动标题" value="{$data.name}">
									  </div>
								  </div>
								  
								 <div class="col-md-4">
									 <div class="form-group">
										<label for="exampleInputEmail1">请输入活动地点</label>
										<input type="text"  name="address" id="address" class="form-control"  placeholder="请输入活动地点" value="{$data.address}">
									  </div>
								  </div>
								  
								   <div class="col-md-4">
								  <div class="form-group">
									<label for="exampleInputEmail1">请选择流派风格</label>
									<select class="form-control" name="style">
										<volist name="style_list" id="style_list">
										<if condition="$style_list.id eq $data.style">
										<option value ="{$style_list.id}" selected="selected">|-- {$style_list.name}</option>
										<else/>
										<option value ="{$style_list.id}">|-- {$style_list.name}</option>
										</if>
										</volist>
									</select>
								  </div>
								  </div>
								  
								  <div class="col-md-4">
								  <div class="form-group">
								<label for="exampleInputEmail1">请选择活动时间</label>
								<input style="height:38px;" name="release_time" placeholder="请输入日期" value='{$time|time|date="Y-m-d",###}' class="form-control laydate-icon gui-input" onclick="laydate()">
								</div>
								</div>
								  
								<div class="col-md-4">
								   <div class="form-group">
									<label for="exampleInputEmail1">请输入票价</label>
									<input type="text"  name="money" id="money" class="form-control"  placeholder="请输入票价" value="{$data.money}">
								  </div>
							  </div>
								
								<br/><br/><br/><br/><br/><br/><br/><br/><br/>
								<div title="选择文件" style="vertical-align:middle; overflow:hidden; width:auto;display:inline-block;position:relative;border:1px solid #ccc; padding:3px 16px;">
									<span>上传图片</span>
									<input id="fileImg" type="file" multiple="multiple" name="img[]"  style="width:40px;height:40px;position:absolute;top:0;left:0;opacity:0;"/>
								</div>
								
								<section>
									<label for="exampleInputEmail1">请输入活动详情</label>
									<label class="input">
									 <script id="container" name="value" type="text/plain">{$data.value}</script>
									 </label>
								</section>
								
								<!-- <div class="form-group">
								<label for="exampleInputEmail1">请输入商品排序(越大越靠前)</label>
								
									<input type="number"  name="sort" id="sort" class="form-control"  placeholder="请输入商品排序" value="{$data.sort}">
									  
								</div> -->
							</fieldset>
							<br>
							<input name="id" type="hidden" value="{$data.id}">
							<footer>
								<button type="submit" class="btn btn-primary" style="width:100%">
									编辑活动
								</button>
							</footer>
								
						</form>						
						
					</div>
					<!-- end widget content -->
					
				</div>
				<!-- end widget div -->
				
			</div>
			<!-- end widget -->	

		</article>
		<!-- END COL -->

		
	<br>
	<br>
	</div>

	<!-- END ROW -->
	
</block>
<block name="Script">
	
  <!-- FooTable Plugin -->
  <script src="__ABSOLUTEADMIN__/vendor/plugins/footable/js/footable.all.min.js"></script>
   <!-- FooTable Addon -->
  <script src="__ABSOLUTEADMIN__/vendor/plugins/footable/js/footable.filter.min.js"></script>

						<script>
						
							//新增配置
							//新增配置
							function change(){  
							
								var username = $("#username").val();
								var nickname = $("#nickname").val();
								
								var tel = $("#tel").val();
								var email = $("#email").val();
								var img = $("#newbikephotoName").val();
								
								$.ajax({
									type:'POST',
									url:"__APP__/Admin/User/Create.html",
									data:{
										
										"username": username,
										"nickname": nickname,
										"tel": tel,
										"email": email,
										"img": img,
										
										
									},
									success:function(data){			
										var info = eval(data)
										if (info.errcode == 0) {
										
											layer.msg(info.errmsg);
											setTimeout(window.location.reload(),3000);
											
										}else{
											layer.msg(info.errmsg);
										}
									},
									error:function(){
										layer.msg('系统繁忙,请稍候重试！');
									}
								
								});	 
							}  
							</script>
 <script type="text/javascript">
  jQuery(document).ready(function() {

 

    // Init FooTable Examples
    $('.footable').footable();


  });
  </script>
</block>